package org.eiahe.hr.attendance.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.ehe.common.core.validate.AddGroup;
import org.ehe.common.core.validate.EditGroup;
import org.ehe.common.mybatis.core.domain.BaseEntity;
import org.eiahe.hr.attendance.domain.SpecialAttendanceRule;

import java.time.LocalDate;

/**
 * 特殊员工考勤规则业务对象 hr_special_attendance_rule
 *
 * @author zhangnn
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = SpecialAttendanceRule.class, reverseConvertGenerate = false)
public class SpecialAttendanceRuleBo extends BaseEntity {

    /**
     * 规则ID
     */
    @NotNull(message = "规则ID不能为空", groups = { EditGroup.class })
    private Long ruleId;

    /**
     * 工号
     */
    @NotBlank(message = "工号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String employeeNo;

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long userId;

    /**
     * 规则内容描述
     */
    @NotBlank(message = "规则内容不能为空", groups = { AddGroup.class, EditGroup.class })
    private String ruleContent;

    /**
     * 规则类型(如:哺乳期,病假等)
     */
    private String ruleType;

    /**
     * 容忍时长(分钟,如迟到容忍30分钟)
     */
    private Integer toleranceMinutes;

    /**
     * 生效日期
     */
    @NotNull(message = "生效日期不能为空", groups = { AddGroup.class, EditGroup.class })
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate effectiveDate;

    /**
     * 失效日期
     */
    @NotNull(message = "失效日期不能为空", groups = { AddGroup.class, EditGroup.class })
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate expiryDate;

    /**
     * 证明材料附件
     */
    private String attachment;

    /**
     * 审批状态(0-待审批 1-部门审批 2-人事审批 3-已通过 4-已拒绝)
     */
    private String approvalStatus;

    /**
     * 备注
     */
    private String remark;
}
